<!-- qna_app/templates/create_question.html -->
{% extends 'base/base.html' %}
{% load custom_filters %}

{% block title %}提问 - 简易问答平台{% endblock %}





{% block content %}
<div class="row">
    <div class="col-md-8 col-md-offset-2">
        <div class="page-header text-center">
            <h1>发布新问题</h1>
            <p class="lead">提出你的疑问，获取社区的帮助</p>
        </div>

        <div class="panel panel-default" style="border-radius: 8px; overflow: hidden;">
            <div class="panel-body">
                <form method="post" class="form-horizontal">
                    {% csrf_token %}
                    
                    <!-- 标题输入框 -->
                    <div class="form-group">
                        <label for="{{ form.title.id_for_label }}" class="col-sm-2 control-label">标题</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="glyphicon glyphicon-question-sign"></i>
                                </div>
                                {{ form.title.errors }}
                                {{ form.title|add_attrs:"class:form-control;placeholder:请用简洁的语言描述你的问题;style:font-size:16px;padding:12px" }}
                            </div>
                            <p class="help-block">一个好的标题能让更多人关注你的问题</p>
                        </div>
                    </div>
                    
                    <!-- 话题选择 -->
                    <div class="form-group">
                        <label for="{{ form.topic.id_for_label }}" class="col-sm-2 control-label">话题</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="glyphicon glyphicon-tag"></i>
                                </div>
                                {{ form.topic.errors }}
                                {{ form.topic|add_attrs:"class:form-control;style:font-size:16px;padding:12px" }}
                            </div>
                        </div>
                    </div>
                    
                    <!-- 问题详情 -->
                    <div class="form-group">
                        <label for="{{ form.content.id_for_label }}" class="col-sm-2 control-label">问题详情</label>
                        <div class="col-sm-10">
                            {{ form.content.errors }}
                            {{ form.content|add_attrs:"class:form-control;rows:8;placeholder:请详细描述你的问题，包括问题背景、你已经尝试过的解决方法等，以便获得更准确的回答;style:font-size:15px;line-height:1.6;padding:12px" }}
                            <p class="help-block">详细的问题描述能帮助他人更好地理解并回答你的问题</p>
                        </div>
                    </div>
                    
                    <!-- 提交按钮 -->
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-primary btn-lg pull-right">
                                <i class="glyphicon glyphicon-send"></i> 发布问题
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
